/**
 *
 * @param  {string} baseUrl
 * @param  {Array} urlMap 现有接口链接
 * @param  {Array} letMap  默认权限
 */

const baseUrl = "/manager/"

//接口访问权限对应变量
let urlMap = {
  getUserList: baseUrl + 'users/list',
}


//变量与接口名对应
const letMap = {
  getUserList: false,
}


const SetAccessRule = (urlList, urlMap, letMap) => {
  for (let item in urlList) {
    SetMapRelationTrue(urlList[item].url, urlMap, letMap)
  }
  return letMap
}


const SetMapRelationTrue = (url, urlMap, letMap) => {
  for (let item in urlMap) {
    if (url == urlMap[item]) {
      letMap[item] = true
    }
  }

}


export {
  letMap,
  urlMap,
  SetAccessRule,
}